﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DGM.Util.Helpers.OAuth_dotnet.Clients;
using DGM.Util.Helpers.OAuth_dotnet.Sources;

namespace DGM.Util.Helpers.OAuth_dotnet
{
  public static class OAuthHelper
  {
    public static IOAuth GetOAuthClient(OAuthClient client, IOAuthGetAccessTokenCallback callback)
    {
      switch (client)
      {
        case OAuthClient.DropBox:
          var oAuthDropbox = new OAuthDropBox(callback);
          oAuthDropbox.GetRequestToken();
          oAuthDropbox.AuthorizeToken();
          return oAuthDropbox;
        case OAuthClient.LinkedIn:
          var oAuthLinkedIn = new OAuthLinkedIn(callback);
          oAuthLinkedIn.GetRequestToken();
          oAuthLinkedIn.AuthorizeToken();
          return oAuthLinkedIn;
      }

      return null;
    }
  }
}
